package org.familysearch.fsapi.gwt.samples.client.handlers;

import org.familysearch.fsapi.gwt.common.client.entities.Person;
import org.familysearch.fsapi.gwt.samples.client.ReadPersonSample;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class PersonReadHandler implements AsyncCallback {

	public void onFailure(Throwable caught) {
		GWT.log(caught.getLocalizedMessage(), null);
		ReadPersonSample.get().showError(caught.getLocalizedMessage());
	}

	public void onSuccess(Object result) {
		GWT.log(result.toString(), null);
		Person person = (Person) result;
		ReadPersonSample.get().showPerson(person);
	}

}
